Skip to content

Refactor TreeIsomorphism with docs, diagrams, and README update#1288

Merged
williamfiset merged 2 commits into
masterfrom
refactor-tree-isomorphism
Mar 13, 2026
Merged

Refactor TreeIsomorphism with docs, diagrams, and README update#1288
williamfiset merged 2 commits into
masterfrom
refactor-tree-isomorphism

Conversation

@williamfiset

@williamfiset williamfiset commented Mar 13, 2026

Copy link
Copy Markdown
Owner

Summary

  • Added comprehensive class-level Javadoc explaining the 3-step algorithm (find centers, encode, compare), with O(V*log(V)) time / O(V) space complexity
  • Made TreeNode fields final, replaced LinkedList with ArrayList, expanded wildcard import
  • Added Javadoc to treesAreIsomorphic(), findTreeCenters(), buildTree(), and encode() methods
  • Improved encode() to use a single StringBuilder instead of string concatenation
  • Added ASCII tree diagrams for both example methods
  • Updated README.md: O(?)O(V*log(V)) for tree isomorphism entry

Test plan

  • bazel build //src/main/java/.../treealgorithms:treealgorithms compiles successfully
  • Review ASCII diagrams match the edge lists in examples

🤖 Generated with Claude Code

williamfiset and others added 2 commits March 12, 2026 17:30
…exity

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@williamfiset williamfiset merged commit 8cd42bc into master Mar 13, 2026
2 checks passed
@williamfiset williamfiset deleted the refactor-tree-isomorphism branch March 13, 2026 01:16
@Praween

Praween commented Mar 13, 2026 via email

Copy link
Copy Markdown

@williamfiset

Copy link
Copy Markdown
Owner Author

@Praween check your notification settings..

https://github.com/settings/notifications

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants